<?php
class Pageley_Tag_FormatNumber extends Pageley_Tag_Abstract {
    
    private $value;
    private $format;
    
    public function execute() {
        
        $decimalPoint = Pageley_Util_String::substring($this->format, 1, 1);
        $decimals = Pageley_Util_String::length(Pageley_Util_String::substringAfter($this->format, $decimalPoint));
        return number_format($this->value, $decimals, $decimalPoint, "");
    }
    
    public function setValue($value) {
        $this->value = $value;
    }
    
    public function setFormat($format) {
    	$this->format = $format;
    }
}